﻿#ifndef CMDFRAME_H
#define CMDFRAME_H

#include "baseframe.h"

namespace IGBTProtocol
{
    class IGBTPROTOCOL_EXPORT CmdFrame : public BaseFrame
    {
        protected:
            CmdFrame();
            static unsigned char _cmdSNCount;

        public:
            CmdFrame(CmdType cmdType, unsigned int cmdDataSize);

        protected:
            CmdType _cmdType;
            unsigned char _cmdCount;

        public:
            CmdType cmdType() const { return _cmdType; }
            static CmdType judge(QByteArray* buff);
            virtual bool depack(QByteArray* buff);
            virtual unsigned int frame(QByteArray* buff, bool tail = false);
    };
}

#endif // CMDFRAME_H
